452A - Eevee - CodeForces Solution


brute force implementation strings *1000

Please click on ads to support us..

Python Code:

n=int(input())
x=["jolteon", "flareon", "umbreon", "leafeon", "glaceon", "sylveon"]
mm=input()
if n==6:
    print("espeon")
elif n==8:
    print("vaporeon")
else:
    for i in range(len(x)):
        ff=1
        for j in range(len(x[i])):
            if mm[j]!='.' and x[i][j]!=mm[j]:
                ff=0
                break
        if ff==1:
            print(x[i])
            break

C++ Code:

#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    string s,ss;
    cin >> n >> s;
    string a[8]={"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"};
    for(int i=0;i<8;i++){
        ss=s;
        for(int j=0;j<n;j++){
            if(ss[j]=='.'){
                ss[j]=a[i][j];
            }
        }
        if(ss==a[i]){
            cout << a[i];
            return 0;
        }
    }
    return 0;
}


Comments

Submit
0 Comments
More Questions

1658B - Marin and Anti-coprime Permutation
14B - Young Photographer
143A - Help Vasilisa the Wise 2
320A - Magic Numbers
1658A - Marin and Photoshoot
514A - Chewbaсca and Number
382A - Ksenia and Pan Scales
734B - Anton and Digits
1080A - Petya and Origami
1642D - Repetitions Decoding
1440A - Buy the String
1658F - Juju and Binary String
478A - Initial Bet
981A - Antipalindrome
365A - Good Number
1204B - Mislove Has Lost an Array
1409D - Decrease the Sum of Digits
1476E - Pattern Matching
1107A - Digits Sequence Dividing
1348A - Phoenix and Balance
1343B - Balanced Array
1186A - Vus the Cossack and a Contest
1494A - ABC String
1606A - AB Balance
1658C - Shinju and the Lost Permutation
1547C - Pair Programming
550A - Two Substrings
797B - Odd sum
1093A - Dice Rolling
1360B - Honest Coach